package bookstudytest.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Auther: Lee
 * @Date: 2018/7/25 17:10
 * @Description:
 */
public class DateDemo {
    public static void main(String[] args) throws InterruptedException, ParseException {
        ttt();
        translate();
    }

    public static void ttt() throws InterruptedException {
        Date date = new Date();
        Thread.sleep(2000);
        Date date1 = new Date();
        System.out.println("aaa:" + date + " bbb:" + date1);
        boolean before = date.before(date1);
        System.out.println(before);
        System.out.println(date.after(date1));

    }

    public static void translate() throws ParseException {
        String dateStr = "2017.07.25-11:23:33";
        SimpleDateFormat format = new SimpleDateFormat();
        //2018/7/25 todo:parse方法的具体实现
        Date date = format.parse(dateStr);
        System.out.println(date);
    }

}
